/*
 * @Author: your name
 * @Date: 2021-07-23 16:50:11
 * @LastEditTime: 2021-07-24 20:51:26
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \hm-news\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout'
import Login from '@/views/login'
import NotFound from '@/views/404'

import Home from '@/views/layout/home'
import Question from '@/views/layout/qusetion'
import Video from '@/views/layout/video'
import User from '@/views/layout/user'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: '',
        component: Home
      },
      {
        path: '/question',
        component: Question
      },
      {
        path: '/video',
        component: Video
      },
      {
        path: '/user',
        component: User
      }
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/404',
    component: NotFound
  }
]

const router = new VueRouter({
  routes
})

export default router
